package com.cloudwebrtc.voip.sipenginev2.impl;

import com.cloudwebrtc.voip.sipenginev2.SipProfile;
import com.cloudwebrtc.voip.sipenginev2.SipProfileManager;

public class SipProfileManagerImpl implements SipProfileManager {
	//implement for SipProfileManager_JNI.cpp
	private long nativePtr = 0;
	private native long SelectSipProfile(long nativePtr,String name);
	private native boolean DeleteSipProfile(long nativePtr,long profilePtr);
	public SipProfileManagerImpl(long aNativePtr)
	{
		nativePtr = aNativePtr;
	}

	@Override
	public SipProfile selectSipProfile(String profile_name) {
		long sipProfilePtr = SelectSipProfile(nativePtr,profile_name);
		return new SipProfileImpl(sipProfilePtr);
	}

	@Override
	public boolean deleteSipProfile(SipProfile profile) {
		SipProfileImpl impl = (SipProfileImpl) profile;
		return DeleteSipProfile(nativePtr,impl.GetNativePtr());
	}
}
